package com.hqyj.springCloundWeb.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;


@Controller
public class AccountController {

    /**
     * 127.0.0.1:8081/register
     * @param modelMap
     * @return
     */
    @GetMapping(value = "/register")
    public String register(ModelMap modelMap){
        modelMap.addAttribute("template","account/register");
        return "index3";
    }

    /**
     * 127.0.0.1:8081/login
     * @param modelMap
     * @return
     */
    @GetMapping(value = "/login")
    public String login(ModelMap modelMap){
        modelMap.addAttribute("template","account/login");
        return "index3";
    }

    @GetMapping("/account/users")
    public String usersPage(){
        return "index";
    }


    @GetMapping("/account/roles")
    public String rolesPage(){
        return "index";
    }

    @GetMapping("/account/resources")
    public String resourcesPage(){
        return "index";
    }


    @GetMapping(value = "/logout")
    public String logout(){

        return "redirect:/login";
    }


}
